<template>
  <div class="setChild">
    <br />
    <p>
      同名：
      <input placeholder="输入名字" v-model="formChild.name" />
    </p>
    <p>
      年龄：
      <input placeholder="输入年龄" v-model="formChild.age" />
    </p>
    <p>
      爱好：
      <input placeholder="输入爱好" v-model="formChild.hop" />
    </p>
  </div>
</template>
<script setup>
import { reactive ,defineEmits,defineProps,computed,watch} from 'vue';
let formChild = reactive({});
const prop= defineProps(['formData']);
// const emit =defineEmits(['update:formData']);

// formChild=computed(() => prop.formData);
watch(()=>prop.formData,(newValue,oldVale)=>{
  console.log('----',newValue,oldVale);
  formChild=newValue;
},{
  deep:true,
  immediate:true
});

</script>
